From: Stefan Monnier Date: Tue, 20 Apr 2004 20:40:41 +0000 (+0000) Subject: (read-number): Check whether `default' is nil. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~23068 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=f1eb6d1fdec6a71a0ab8addb3a3cd3cc1e87e5d2;p=emacs.git (read-number): Check whether `default' is nil. --- diff --git a/lisp/subr.el b/lisp/subr.el index 39a9caa3106..81f774bdc68 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1329,7 +1329,8 @@ Optional DEFAULT is a default password to use instead of empty input." (while (progn (let ((str (read-from-minibuffer prompt nil nil nil nil - (number-to-string default)))) + (and default + (number-to-string default))))) (setq n (cond ((zerop (length str)) default) ((stringp str) (read str)))))